<!--helwan-->

<?php
session_start();
include 'admin.php';
include 'data_access.php';
$admin=new admin();
$database_name="helwan_hostes";
$connect=new database_access();
$connect->connect();
$admin->name=$_POST['name'];
$admin->password=$_POST['password'];
   $check=$admin->adminlogin($admin->name,$admin->password);
   if($check){
       $_SESSION['adminability']=$admin->name;
      header('location: index.php');
   }
   else{
       session_destroy();

echo"<script language='javascript' type='text/javascript'>
alert('Invalid name or password!');
</script>";
//header("location:adminform.php");
   }
?>